﻿using System.Windows;

namespace MDrive.Views
{
    public partial class MDriveParameterView
    {
        public MDriveParameterView()
        {
            InitializeComponent();
            SendValueTextBox.Visibility = Visibility.Hidden;
            SendRequestToggleButton.Visibility = Visibility.Hidden;
        }

        private void OnReadValueGotFocus(object sender, RoutedEventArgs e)
        {
            SendValueTextBox.Text = ReadValueTextBox.Text;
            SendValueTextBox.Visibility = Visibility.Visible;
            SendRequestToggleButton.Visibility = Visibility.Visible;
            SendValueTextBox.Focus();
            SendValueTextBox.SelectAll();
        }

        private void OnSendValueLostFocus(object sender, RoutedEventArgs e)
        {
            SendValueTextBox.Visibility = Visibility.Hidden;
            SendRequestToggleButton.Visibility = Visibility.Hidden;
            SendRequestToggleButton.IsChecked = true;
        }
    }
}
